<?php

namespace App\Http\Controllers;

use App\Library\Rms\RmsPayApi;
use Illuminate\Support\Facades\Http;

class HelloController extends BaseController
{
    public function wxWapPay()
    {
        $sysType    = 4;
        $orderNo    = 123123;
        $payChannel = 2;
        $h5BackUrl  = 'http://qa-b.51kuafu.com/api/b/hello';
        $data       = (new RmsPayApi($sysType))->wapPay($orderNo, '招商加盟费', 1, $payChannel, $h5BackUrl, 0);
        $h5Url      = $data['data']['wapPayData']['h5_url'];


        return Http::withHeaders([
            'Referer' => 'https://qa-b.51kuafu.com/operation/product/list',
        ])
                   ->get($h5Url)
                   ->body();
    }

    public function aliWapPay()
    {
        $sysType    = 4;
        $orderNo    = 123123;
        $payChannel = 1;
        $h5BackUrl  = 'http://qa-b.51kuafu.com/api/b/hello';
        $data       = (new RmsPayApi($sysType))->wapPay($orderNo, '招商加盟费', 1, $payChannel, $h5BackUrl, 0);
        return $data['data']['wapPayData']['body'];
    }
}
